﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="attachment.aspx.cs" Inherits="members_controls_attachment" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <script type="text/javascript">
        var CloseandDeletemyaccountMsg = "<%=MemberRes.CloseandDeletemyaccountMsg%>";
        var SaveProfileMsg = "<%=MemberRes.SaveProfileMsg%>";
        function CheckFile(str, value, id) {
            var strRegex = value; //用于验证图片扩展名的正则表达式
            var re = new RegExp(strRegex);
            if (re.test(str)) {
                return (true);
            }
            else {
                document.getElementById(id).value = "";
                alert("<%=MemberRes.UpLoadMsg%>");
                return (false);
            }
        };
</script>
</head>
<body>
    <form id="form1" runat="server" enctype="multipart/form-data">
        <div>
             <%=MemberRes.Portrait %>:<br />
            <asp:Image ID="ImgPortrait" runat="server" />
            <input id="FUploadImg" name="FUploadImg" type="file" onchange="CheckFile(this.value,'(.jpg|.JPG|.gif|.GIF|.png|.PNG|.jpeg|.jpeg)$','FUploadImg');"/>
            <asp:Button ID="BtnUpLoad" runat="server" Text="<%$ Resources:BtnRes,UploadAvatar%>" ValidationGroup="EditProfile" OnClick="BtnUpLoad_Click"  />
            <asp:Label ID="UpLoadMsg" runat="server" Text=""></asp:Label>
        </div>
    </form>
</body>
</html>
